<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'employee-daily-report-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">带 <span class="required">*</span> 为必填项目</p>

	<?php echo $form->errorSummary($model); ?>
<?php 
$isToday=(date('Y-m-d')==$model->reportDate);
?>
	<div class="row">
		<?php echo $form->labelEx($model,'reportDate'); ?>
		<?php echo CHtml::radioButtonList('datePick', $isToday?0:1, array('今天（'.date('Y-m-d').'）','其它'),array(
				'separator'=>'',
				'labelOptions'=>array('style'=>'display:inline;float:none;'),
				'onclick'=>'if(this.value==1){$("#form-date-pick-calendar").css("display","");}else{$("#form-date-pick-calendar").css("display","none");$("#'.CHtml::activeId($model, 'reportDate').'").val("'.date('Y-m-d').'");}'
			)); ?>
		<span id="form-date-pick-calendar" style="<?php echo $isToday?"display:none;":""; ?>">
		<?php $this
			->widget('zii.widgets.jui.CJuiDatePicker',
				array(
					'model' => $model,
					'attribute' => 'reportDate',
				));
		?></span>
		<?php echo $form->error($model,'reportDate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'workStatus'); ?>
		<?php echo $form->radioButtonList($model,'workStatus',EmployeeDailyReport::getWorkStatuses(),array(
				'separator'=>'',
				'labelOptions'=>array('style'=>'display:inline;float:none;'),
				'onclick'=>'if(this.value==1){$("#form-work-absence").css("display","none");$("#form-work-normal").css("display","");}else{$("#form-work-absence").css("display","");$("#form-work-normal").css("display","none");}'
			)); ?>
		<?php echo $form->error($model,'workStatus'); ?>
	</div>
	
	<div id="form-work-absence" style="<?php echo $model->workStatus?"display:none;":""; ?>">
	<div class="row">
		<?php echo $form->labelEx($model,'workAbsenceReason'); ?>
		<?php echo $form->textField($model,'workAbsenceReason',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'workAbsenceReason'); ?>
	</div>
	</div>
	
	<div id="form-work-normal" style="<?php echo $model->workStatus?"":"display:none;"; ?>">
	<div class="row">
		<?php echo $form->labelEx($model,'workSummary'); ?>
		<?php echo $form->textField($model,'workSummary',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($model,'workSummary'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'workDescription'); ?>
		<?php echo $form->textArea($model,'workDescription',array('rows'=>10, 'cols'=>70)); ?>
		<?php echo $form->error($model,'workDescription'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'workSuggestion'); ?>
		<?php echo $form->textArea($model,'workSuggestion',array('rows'=>10, 'cols'=>70)); ?>
		<?php echo $form->error($model,'workSuggestion'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'workTechnicProblem'); ?>
		<?php echo $form->textArea($model,'workTechnicProblem',array('rows'=>10, 'cols'=>70)); ?>
		<?php echo $form->error($model,'workTechnicProblem'); ?>
	</div>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'workNextDayPlan'); ?>
		<?php echo $form->textArea($model,'workNextDayPlan',array('rows'=>10, 'cols'=>70)); ?>
		<?php echo $form->error($model,'workNextDayPlan'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton('保存'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->